﻿/*
 * Created by SharpDevelop.
 * User: Михаил
 * Date: 28.07.2013
 * Time: 15:00
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */
using System;

namespace Region.Utils
{
	/// <summary>
	/// Description of ListItemValue.
	/// </summary>

    public class ListItemValue
    {
        public String Text;
        public Object Value;
        public ListItemValue(String Text, Object Value) { this.Text = Text; this.Value = Value; }
        public override string ToString()
        {
            return Text;
        }
        public override bool Equals(object obj)
        {
            if (obj == null) return false;
            if (obj.GetType() != GetType()) return false;
            ListItemValue v = ((ListItemValue)obj);
            if (Value==null && v.Value==null) return true;
            if (Value==null ) return false;
            if (v.Value==null ) return false;
            return Value.Equals(v.Value) && Text.Equals(v.Text);
        }
        public override int GetHashCode()
        {
            return Text.GetHashCode() ^ Value.GetHashCode();
        }
    }
}
